<script setup>
import { useRoute, useRouter } from 'vue-router'
import { useUserStore } from './stores'
const userStore = useUserStore()

const route = useRoute()
const router = useRouter()
const goList = () => {
  console.log(router, route)
  router.push('/list')
}
</script>

<template>
  <hr />
  <router-view></router-view>
  <hr />
  <hr />
  <hr />
  <div>我是APP</div>
  <!-- 直接使用components中的组件 无需导入 -->
  <Text></Text>
  <el-button @click="goList">跳首页</el-button>
  <el-button @click="$router.push('/home')">跳列表</el-button>

  <p>{{ userStore.token }}</p>
  <el-button @click="userStore.setToken('wqdcqdc')">登录</el-button>
  <el-button @click="userStore.removeToken()">退出</el-button>
</template>

<style scoped></style>
